﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.Linq;
using System.Data.Linq;

using BISPOS.Repository;
namespace BISPOS
{
    public partial class AddNewProductXtraForm_SelectProductGroup : DevExpress.XtraEditors.XtraForm
    {
        AddNewProductXtraForm form;
        ProductRepository repository = new ProductRepository();
        public AddNewProductXtraForm_SelectProductGroup(AddNewProductXtraForm _form)
        {
            InitializeComponent();
            form = _form;
            linqServerModeSource1.QueryableSource = repository.AllProductGroups().AsQueryable();
        }

        private void ProductGroupListBox_DoubleClick(object sender, EventArgs e)
        {
            try
            {

                this.form.ChangeProductGroup((int)this.ProductGroupListBox.SelectedValue);
                this.Close();

            }
            catch { }
        }
    }
}